﻿@{
    ViewBag.Title = "订单信息";
    var order = ViewBag.Order as CubicFWNet.Data.ViewModal.OrderInfo;
    var proList = ViewBag.ProList as List<CubicFWNet.Data.ViewModal.ProductView>;
    Layout = "~/Views/Shared/_InfoPage.cshtml";
}
<style>
    .panelLayout {
        border: dotted 1px #aaa;
        margin-bottom: 10px;
        padding-top: 10px;
    }

    .linkLayout {
        color: dodgerblue;
        border: none;
        cursor: pointer;
    }
</style>
<section class="content">
    <form class="form-horizontal" method="post" id="formMain">
        <div class="box box-solid">
            <div class="box-body">

                @if (order.Stage != 2)
                {
                <div class="row">
                    <div class="form-group col-md-6 col-sm-12">
                        <label for="Number" class="col-sm-3 control-label">内部订单号</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" value="@order.Number" readonly />
                        </div>
                    </div>

                    <div class="form-group col-md-6 col-sm-12">
                        <label for="Number" class="col-sm-3 control-label">客户订单号</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" value="@order.CusNumber" readonly/>
                        </div>
                    </div>

                    <div class="form-group col-md-6 col-sm-12">
                        <label for="Number" class="col-sm-3 control-label ">客户名称</label>
                        <div class="col-sm-9" style="border:none">
                            @*<span onclick="ShowModal('@order.CustomeId')" name="CustomerName" id="CustomerName" class="form-control linkLayout">@order.CustomerName</span>*@
                            <input type="text" name="CustomerName" id="CustomerName" class="form-control " readonly value="@order.CustomerName" />
                        </div>
                    </div>

                    <div class="form-group col-md-6 col-sm-12">
                        <label  class="col-sm-3 control-label">发货方式</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" value="@order.Delivery" readonly />
                        </div>
                    </div>

                    <div class="form-group col-md-6 col-sm-12">
                        <label for="SendTime" class="col-sm-3 control-label">希望交货期</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" value="@order.SendTime" readonly />
                        </div>
                    </div>
                </div>
                }

                <div id="divProList">
                    @foreach (var item in proList)
                    {
                        <div class="row panelLayout">
                            <div class="form-group col-md-6 col-sm-12">
                                <label for="Creator" class="col-sm-3 control-label">产品名称</label>
                                <div class="col-sm-9">
                                    <input type="text" class="form-control" value="@item.Name" readonly="readonly" />
                                </div>
                            </div>
                            <div class="form-group col-md-6 col-sm-12">
                                <label for="Creator" class="col-sm-3 control-label">订货数量</label>
                                <div class="col-sm-9 form-inline">
                                    <input type="text" class="form-control" value="@item.Amount" readonly="readonly" />
                                    <b class="text-danger"> 已出库：@item.SendAmount</b>
                                </div>
                            </div>

                            <div class="form-group col-md-6 col-sm-12">
                                <label for="Creator" class="col-sm-3 control-label">价格</label>
                                <div class="col-sm-9">
                                    <input type="text" class="form-control" value="@item.FinalPrice" readonly="readonly" />
                                </div>
                            </div>
                             <div class="form-group col-md-6 col-sm-12">
                                <label for="Creator" class="col-sm-3 control-label">产品信息</label>
                                <div class="col-sm-9">
                                    <span class="btn bg-blue btn-xs" onclick="ShowModal('@item.ProductID')">查看产品信息</span>
                                </div>
                            </div>
                        </div>
                    }
                </div>

                <div class="row">
                    <div class="form-group col-md-6 col-sm-12">
                        <label for="Memo" class="col-sm-3 control-label">备注</label>
                        <div class="col-sm-9">
                            <textarea rows="3" class="form-control" readonly>@order.Memo</textarea>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="form-group col-md-6 col-sm-12">
                        <label for="Creator" class="col-sm-3 control-label">创建人</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" id="Creator" name="Tolerance" value="@order.CreatorName" readonly="readonly" />
                        </div>
                    </div>
                    <div class="form-group col-md-6 col-sm-12">
                        <label for="CreateTime" class="col-sm-3 control-label">创建时间</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" id="CreateTime" value="@order.CreateTime" readonly="readonly" />
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </form>
</section>

<script>
    function ShowModal(id) {
        var options = {
            id: null,
            title: '产品信息',
            width: "100%",
            height: "100%",
            url: "../Product/Info?PID=" + id,
            shade: 0.3,
            btn: ['返回'],
            btnclass: ['btn btn-danger'],
            callBack: null
        }
        $.modalOpen(options);
    }
</script>
